<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //for语句格式和c语言一样
        for(var i = 1; i<=50; i++){
            if(i == 25){
                break;
            }
            if(i % 2 == 1){
                continue;
            }
            console.log("i="+i);//数字和字符串可通过+号连接
        }

        //while也和c语言一致
        var i = 1;
        while(i <= 20){
            i++;
        }
    </script>
</body>
</html>